import request from '@/utils/request'

// 获取列表
export function getBrokerList(data) {
  return request.get(`/agents?_limit=${data.limit}&_start=${data.start}&name_contains=${data.name}`)
}

// 获取数量
export function getCount(data) {
  return request.get(`/agents/count?name_contains=${data.name}`)
}

// 添加
export function addBroker(data) {
  return request.post('/agents', data)
}

// 删除
export function delBroker(id) {
  return request.delete(`/agents/${id}`)
}

// id获取详情
export function getDetailBroker(id) {
  return request.get(`/agents/${id}`)
}

// 编辑
export function editBroker(data) {
  return request.put(`/agents/${data.id}`)
}
